﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QLabel>
#include <QMainWindow>
#include <QStandardItemModel>
#include <QItemSelectionModel>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
private:
    QStandardItemModel *m_model;
    QItemSelectionModel *m_select_model;

    QLabel *m_lab_file;
    QLabel *m_lab_pos;
    QLabel *m_lab_text;

private:
    void initSomeThing();
    int openFileAndDisplay(const QString &filename);
    void initTableModel(QStringList &list);
private slots:
    void on_m_action_Openfile_triggered();
    void on_m_action_modeldata_triggered();
    void on_m_action_add_triggered();
    void on_m_action_insert_triggered();
    void on_m_action_delOne_triggered();
    void on_m_action_Alignleft_triggered();
    void on_m_action_Aligncenter_triggered();
    void on_m_action_Alignright_triggered();
    void on_m_action_bold_triggered();
    void on_m_action_quit_triggered();

    void do_currentChanged(const QModelIndex &current, const QModelIndex &previous);
private:
    Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
